<%@page contentType="text/html" pageEncoding="UTF-8" import="consultas.funciones"%>
<%@page import="consultas.Usuarios"%>
<jsp:useBean id="reg" class="consultas.funciones" scope="session" />


<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>www.queterifas.com</title>
        <link rel="stylesheet" type="text/css" href="css/estilo.css" media="screen" />
        <link href='http://fonts.googleapis.com/css?family=Averia+Sans+Libre' rel='stylesheet' type='text/css'>
        <script>
            function sumarCredito(){
                suma=parseFloat(document.getElementById("credito").value) + parseFloat(document.getElementById("credAdd").value);
                document.getElementById("credTotal").innerHTML=suma+"€";
                document.getElementById("totalCred").value=suma;
            };
        </script>
    </head>
    <body>
        <!-- INCLUDE PARA METER EL HEADER -->
      <jsp:include page="includes/header.jsp"/>
      <section id="contenedor">
          <%
            Usuarios user = reg.consultaUsuario();
          %>
        <br><br>
        <fieldset class="datos_user"><legend>Mi Crédito</legend>
            <form action="control.jsp">
                <label>Crédito Actual: </label><input type="text" value="<%=user.getCredito()%>" class="credit" id="credito" disabled="true"/><br><br>
                    <label>+</label><input type="number" id="credAdd" name="masCred" value="0" min="0" onchange="sumarCredito();"/><br><br>
                    <hr/>
                    <label>Crédito Total: </label><span id="credTotal"></span><input type="hidden" name="totalCred" id="totalCred" /><br><br>
                    <input type="submit" class="buttonM" name="addCred" value="Cargar"/>
                </form><br>
        </fieldset>
        <br><br>
      <!-- INCLUDE PARA METER EL FOOTER -->
      <jsp:include page="includes/footer.jsp"/>  
        
    </body>
</html>
